<?php 
use \PsiFramework\Classes\Util\UI\Printer;
use \PsiFramework\Classes\Util\UI\HTML;

$user = $response->getAttribute("user");
if (is_null($user)) $user = $response->getAttribute("object");

$lang = $response->getAttribute("lang");

?>
<div>
    <form
        class="editForm"
        action="<?php Printer::display(HTML::linkHref('action=CMS.Save&type=User'));?>"
        method="POST"
        enctype="multipart/form-data">
        <input type="hidden" name="redirectAction" value="Profile" />
        <?php
        if ($user!=null && $user->getId() != null) {
        ?>
        <input
            type="hidden"
            name="id"
            value="<?php Printer::display($user->getId()); ?>" />
        <input
            type="hidden"
            name="old_password"
            value="<?php Printer::display($user->getPassword()); ?>" />
        <?php
        }
        ?>
        <div class="label oblig">
            <span class="titre">
                <?php Printer::display($languageManager->getText("LOGIN_NAME")); ?> :
            </span>
            <input
                class="firstInput"
                type="text"
                name="login"
                id="loginBox"
                value="<?php if ($user!=null && $user->getLogin() != null) Printer::display($user->getLogin()); ?>"
                required="required" />
        </div>
        <div class="label oblig">
            <span class="titre">
                <?php Printer::display($languageManager->getText("EMAIL")); ?> : 
            </span>
            <input
                class="firstInput"
                type="email"
                name="email"
                id="emailBox"
                value="<?php if ($user!=null && $user->getEmail() != null) Printer::display($user->getEmail()); ?>"
                required="required" />
        </div>
        <div class="label oblig">
            <span class="titre">
                <?php Printer::display($languageManager->getText("PASSWORD")); ?> : 
            </span>
            <input
                class="firstInput"
                type="password"
                name="password"
                id="passwordBox"
                value="<?php if ($user!=null && $user->getPassword()!=null) Printer::display($user->getPassword()); ?>"
                required="required" />
        </div>
        <input
            type="submit"
            value="<?php Printer::display($languageManager->getText("SUBMIT")); ?>" />
    </form>
</div>
